﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ToolRecordManagement.aspx.cs"
    MasterPageFile="~/Site1.master" Inherits="WebApplication1.RecordManagement.ToolRecordManagement" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  <style type="text/css">
        .anpager
        {
            font: 14px Arial, Helvetica, sans-serif;
            padding: 10px 20px 10px 0;
            margin: 0px;
        }
        .anpager a
        {
            padding: 1px 6px;
            border: solid 1px #ddd;
            background: #fff;
            text-decoration: none;
            margin-right: 2px;
        }
        .anpager a:visited
        {
            padding: 1px 6px;
            border: solid 1px #ddd;
            background: #fff;
            text-decoration: none;
        }
        .anpager .cpb
        {
            padding: 1px 6px;
            font-weight: bold;
            font-size: 13px;
            border: none;
        }
        .anpager a:hover
        {
            color: #fff;
            background: #ffa501;
            border-color: #ffa501;
            text-decoration: none;
        }
        /* AspNetPager1属性设置: CssClass="anpager" CurrentPageButtonClass="cpb"*/</style>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div>
        <br />
        <br />
        <div style="width: 95%; border: solid 1px black; margin: 0 auto;">
            <p>
                方式：<asp:DropDownList ID="DDL_RecordMode" runat="server">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 车间：<asp:DropDownList
                    ID="DDL_WorkShop" runat="server">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 类别：<asp:DropDownList
                    ID="DDL_ToolType" runat="server">
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 分布区域：<asp:DropDownList
                    ID="DDL_DistrbutionArea" runat="server">
                </asp:DropDownList>
            </p>
            <p>
                起始时间：<asp:TextBox ID="Tb_StartTime" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="Tb_StartTime"
                    Enabled="true" Format="yyyy/MM/dd">
                </asp:CalendarExtender>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="Tb_StartTime"
                    ErrorMessage="*" ValidationGroup="VGroup1"></asp:RequiredFieldValidator>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 终止时间：<asp:TextBox
                    ID="Tb_StopTime" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="Tb_StopTime"
                    Enabled="true" Format="yyyy/MM/dd">
                </asp:CalendarExtender>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Tb_StopTime"
                    ErrorMessage="*" ValidationGroup="VGroup1"></asp:RequiredFieldValidator>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </p>
            <p>
                代码：<asp:TextBox ID="Tb_ToolCode" runat="server"></asp:TextBox>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 名称：<asp:TextBox
                    ID="Tb_ToolName" runat="server"></asp:TextBox>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="Button1" runat="server" Text="查　询" OnClick="Button1_Click" ValidationGroup="VGroup1" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="ButAdd" runat="server" Text="继续添加" OnClick="ButAdd_Click" />
            </p>
            <hr />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3"
                CellSpacing="1" GridLines="None" PageSize="20" DataKeyNames="ID" EmptyDataText="没有相关数据！"
                OnPageIndexChanging="GridView1_PageIndexChanging" OnRowCancelingEdit="GridView1_RowCancelingEdit"
                OnRowDataBound="GridView1_RowDataBound" OnRowDeleting="GridView1_RowDeleting"
                OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" Width="100%">
                <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
                <Columns>
                     <asp:TemplateField HeaderText="序号" InsertVisible="False">
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center" />
                        <ItemTemplate>
                            <asp:Label ID="lb" runat="server" Text='<%# this.GridView1.PageIndex * this.GridView1.PageSize + this.GridView1.Rows.Count + 1%>' />
                        </ItemTemplate>
                    </asp:TemplateField> 
                    <asp:TemplateField HeaderText="日期">
                        <EditItemTemplate>
                            <asp:TextBox ID="Tb_RecordDate" runat="server" Text='<%# Bind("Record_Date") %>'></asp:TextBox>
                            <asp:CalendarExtender ID="CalendarExtender3" TargetControlID="Tb_RecordDate" Enabled="true"
                                runat="server"  Format="yyyy/MM/dd">
                            </asp:CalendarExtender>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Record_Date","{0:yyyy/MM/dd}")  %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="方式">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFRecord_Mode" runat="server" Value='<%# Eval("Record_Mode") %>' />
                            <asp:DropDownList ID="DDLRecord_Mode" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("Record_Mode") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="车间">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFWork_Shop" runat="server" Value='<%# Eval("Work_Shop") %>' />
                            <asp:DropDownList ID="DDLWork_Shop" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("Work_Shop") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="类别">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFTool_Type" runat="server" Value='<%# Eval("Tool_Type") %>' />
                            <asp:DropDownList ID="DDLTool_Type" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Tool_Type") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="ProductType" HeaderText="应用产品" />
                    <asp:BoundField DataField="ProductTypeName" HeaderText="应用产品代码" />
                    <asp:BoundField DataField="Tool_Name" HeaderText="名称" />
                    <asp:BoundField DataField="Tool_Code" HeaderText="代码" />
                    <asp:TemplateField HeaderText="型号规格">
                        <EditItemTemplate>
                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("Tool_Type_Spec") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="lbTTSp" runat="server" Text='<%# Bind("Tool_Type_Spec") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Tool_EnableSN" HeaderText="启用编号" />
                    <asp:BoundField DataField="Amount_Input" HeaderText="入库数" />
                    <asp:BoundField DataField="Amount_Output" HeaderText="出库数" />
                    <asp:BoundField DataField="Amount_WriteOff" HeaderText="报废数" />
                    <asp:BoundField DataField="Taker" HeaderText="领用人" />
                    <asp:BoundField DataField="Taker_ID" HeaderText="领用人工号" />
                    <asp:TemplateField HeaderText="分布区域">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFDistribution_Area" runat="server" Value='<%# Eval("Distribution_Area") %>' />
                            <asp:DropDownList ID="DDLDistribution_Area" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("Distribution_Area") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFTool_State" runat="server" Value='<%# Eval("Tool_State") %>' />
                            <asp:DropDownList ID="DDLTool_State" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("Tool_State") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="修复记录">
                        <EditItemTemplate>
                            <asp:HiddenField ID="HDFRepair_Record" runat="server" Value='<%# Eval("Repair_Record") %>' />
                            <asp:DropDownList ID="DDLRepair_Record" runat="server">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("Repair_Record") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Remark" HeaderText="备注" />
                    <asp:CommandField ShowEditButton="True" HeaderText="编辑" />
                    <asp:CommandField ShowDeleteButton="True" HeaderText="删除" />
                </Columns>
                <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
                <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
            </asp:GridView>
            <table>
                <tr>
                    <td>
                          总记录：<asp:Label ID="Lbl_RecordsCount" runat="server" Text=""></asp:Label>条，入库数：<asp:Label
                    ID="Lbl_AmountInput" runat="server" Text=""></asp:Label>，出库数：<asp:Label ID="Lbl_AmountOutput"
                        runat="server" Text=""></asp:Label>，报废数：<asp:Label ID="Lbl_AmountWriteOff" runat="server"
                            Text=""></asp:Label>
                    </td>
                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                    </td>
                    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
                     &nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                     &nbsp;&nbsp;&nbsp;&nbsp;
                    <td align="right">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                            CssClass="anpager" CurrentPageButtonClass="cpb" FirstPageText="首页" LastPageText="尾页"
                            NextPageText="下一页" PrevPageText="上一页" PageSize="20">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
            
        </div>
    </div>
</asp:Content>
